<?php
namespace Client\Model;

class Order
{
    private static $status = array(
        '1' => '未付款',
        '2' => '未发货',
        '3' => '已发货',
        '4' => '已取消',
    );
    
    const TYPE_FOOD = 1;
    const TYPE_MALL = 2;
    
    public static function filter(&$order)
    {
        $total_amount = 0;
        if (!empty($order['item_list'])) {
            foreach ($order['item_list'] as $item) {
                $total_amount += $item['oi_amount'];
            }
        }  
        $order['total_amount'] = $total_amount;
        $order['status_name'] = Order::$status[$order['status']];
    }
    
    public static function calTotalPrice($order)
    {
        $totalPrice = 0;
        return $totalPrice;
    }
    
}